package cn.myjerry.collection;

import java.util.HashMap;
import java.util.Map;

/**
 * 测试map的基本用法
 * @author Jerry
 * 
 */

public class TestMap {
	public static void main(String[] args) {
		Map<String, Wife> map = new HashMap<String, Wife>();
		map.put("Jerry", new Wife("靳珍珍"));
		map.put("许文强", new Wife("杨珊"));
		
		Wife w = (Wife) map.get("Jerry");
		
		//map.remove("Jerry");
		
		System.out.println(w.name);
		
		System.out.println(map.size());
	}
}

class Wife {
	String name;

	public Wife() {
	}
	
	public Wife(String name) {
		super();
		this.name = name;
	}
	
}